﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using anks.Components;

namespace pygs
{
    public class Registration
    {
        public static void RegisterComponents(ComponentRegistry registry)
        {
            // application
            registry.RegisterFactory("application", "main", new ComponentFactory<Application.MainApplication>(), true);

            // security
            registry.RegisterFactory("security", "none", new ComponentFactory<Security.NoneSecurity>(), true);
            registry.RegisterFactory("security", "ws", new ComponentFactory<Security.WSSecurity>());

            // messaging
            registry.RegisterFactory("messaging", "none", new ComponentFactory<Messaging.NoneMessaging>());
            registry.RegisterFactory("messaging", "fw", new ComponentFactory<Messaging.FwMessaging>(), true);

            // messaging buffer
            registry.RegisterFactory("messaging.buffer", "memory", new ComponentFactory<Messaging.Buffer.MemoryBuffer>(), true);

            // messaging transport
            registry.RegisterFactory("messaging.transport", "none", new ComponentFactory<Messaging.Transport.NoneTransport>(), false);
            registry.RegisterFactory("messaging.transport", "file", new ComponentFactory<Messaging.Transport.FileTransport>(), true);
            registry.RegisterFactory("messaging.transport", "ws", new ComponentFactory<Messaging.Transport.WSTransport>(), false);

            // locator
            registry.RegisterFactory("locator", "gps-intermediate", new ComponentFactory<Locator.GPSILocator>(), true);
            registry.RegisterFactory("locator", "fake", new ComponentFactory<Locator.FakeLocator>(), false);

            // ui
            registry.RegisterFactory("ui", "win", new ComponentFactory<UI.WinUI>(), true);
        }
    }
}
